var e = {
    videoAdErrCodeHandle: function(e) {
        var t = "";
        switch (console.info(e), e.errCode) {
          case 1e3:
          case 1001:
          case 1002:
          case 1003:
          case 1004:
          case 1005:
            t = "暂无合适的广告可以播放";
            break;

          case 1006:
            t = "暂无合适的广告可以播放。";
            break;

          case 1007:
          case 1008:
            t = "暂无合适的广告可以播放";
            break;

          default:
            t = "广告播放失败，可能是因为播放中途退出的缘故。您可以通过进入手机后台任务列表，退出当前小程序，然后重新进入小程序，重新播放。播放结束后，点击屏幕上的关闭按钮即可获得奖励。";
        }
        wx.showModal({
            title: "提示",
            content: t,
            showCancel: !1
        });
    },
    setHistory: function(e) {
        try {
            e.time = Date.parse(new Date());
            var t = {
                history: [],
                sum: 1,
                weitou: 0,
                dietou: 0
            }, o = wx.getStorageSync("dahuatouziHistory");
            if ("" != o) {
                t.sum = o.sum + 1;
                var r = [];
                e.shaizis.forEach(function(t, o) {
                    var i = e.locations[o];
                    o < e.num && e.num > 2 && 1 != i && r.indexOf(i) < 0 && r.push(i);
                });
                var i = null == o.weitou ? 0 : o.weitou;
                t.weitou = r.length <= 1 && e.num > 2 && "pillars" != e.model ? i + 1 : i;
                var s = null == o.dietou ? 0 : o.dietou;
                t.dietou = "pillars" == e.model && e.num > 1 ? s + 1 : s, t.history = o.history, 
                t.history.splice(0, 0, e);
                var a = wx.getStorageSync("canUserSetMoreHistory"), u = !1;
                "" != a && (Date.parse(new Date()) - a.time) / 1e3 < 86400 && (u = !0), t.history = t.history.slice(0, u ? 50 : 5);
            } else t.history.push(e);
            wx.setStorageSync("dahuatouziHistory", t);
        } catch (e) {}
    },
    getHistory: function() {
        var e = {
            history: [],
            sum: 0,
            weitou: 0,
            dietou: 0
        }, t = wx.getStorageSync("dahuatouziHistory");
        return "" != t && (e = t), e;
    },
    removeHistory: function() {
        wx.removeStorageSync("dahuatouziHistory");
    }
};

module.exports = {
    setHistory: e.setHistory,
    getHistory: e.getHistory,
    removeHistory: e.removeHistory,
    videoAdErrCodeHandle: e.videoAdErrCodeHandle
};